package com.gs.synedocket.model;


import com.gs.synedocket.apiresult.ApiResultData;
import com.gs.synedocket.constant.DbMsg;
import com.gs.synedocket.db.sqlite.DBApi;
import com.gs.synedocket.model.listener.OnResultListener;
import com.gs.synedocket.util.OKHttpUtil;
import com.gs.synedocket.util.ThreadManager;

import java.lang.reflect.Type;

public class MenuModel {
    public void menus(String id, String quick, final OnResultListener onResultListener,
                      Type typeofT) {
//        OKHttpUtil.getInstance().getAsync(OKHttpUtil.NET_URL + "/api/menus?pId=" + id + "&quick=" + quick + "&view=App", new Callback() {
//            @Override
//            public void onSuccess(Object obj) {
//                onResultListener.onSuccess(obj);
//            }
//
//            @Override
//            public void onFailed(Exception e) {
//                onResultListener.onFails(e);
//            }
//        }, typeofT);
        ApiResultData<Object> result = new ApiResultData<>();
        result.setStatus(2000);
        result.setMessage(DbMsg.QUERY_SUCCESS);
        result.setData(DBApi.getInstance().queryMenu(id, quick));
        onResultListener.onSuccess(result);
//        OKHttpUtil.getInstance().getHandler().post(()->onResultListener.onSuccess(result));
    }
}
